home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
libs
/
pdcurs21
/
portable
/
wprintw.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-18
|
2KB
|
82 lines
#include <stdarg.h>
#include <string.h>
#define CURSES_LIBRARY 1
#include <curses.h>
#undef wprintw
#ifdef PDCDEBUG
char *rcsid_wprintw = "$Header: C:\CURSES\portable\RCS\wprintw.c 2.1 1993/06/18 20:21:48 MH Rel MH $";
#endif
/*man-start*********************************************************************
wprintw() - formatted write to a window
X/Open Description:
The printw routine adds a string to the default window
starting at the current cursor position. This routine causes
the string that would normally be output by printf to be
output by addstr.
The routine wprintw adds a string to the specified window
starting at the current cursor position. This routine causes
the string that would normally be output by printf to be
output by waddstr.
The routine mvprintw adds a string to the default window
starting at the specified cursor position. This routine
causes the string that would normally be output by printf to
be output by addstr.
The routine mvwprintw adds a string to the specified window
starting at the specified cursor position. This routine
causes the string that would normally be output by printf to
be output by waddstr.
All these routines are analogous to printf. It is advisable
to use the field width options of printf to avoid leaving
unwanted characters on the screen from earlier calls.
PDCurses Description:
The old Bjorn Larssen code for the 68K platform has been removed
from this module.
X/Open Return Value:
The printw() function returns OK on success and ERR on error.
X/Open Errors:
No errors are defined for this function.
Portability:
PDCurses int wprintw( WINDOW* win, char *fmt, ... );
X/Open Dec '88 int wprintw( WINDOW* win, char *fmt, ... );
BSD Curses int wprintw( WINDOW* win, char *fmt, ... );
SYS V Curses int wprintw( WINDOW* win, char *fmt, ... );
**man-end**********************************************************************/
int wprintw(WINDOW * win, char *fmt,...)
{
int retval = ERR;
va_list args;
#ifdef PDCDEBUG
if (trace_on) PDC_debug("wprintw() - called\n");
#endif
if (win == (WINDOW *)NULL)
return (retval);
va_start(args, fmt);
vsprintf(c_printscanbuf, fmt, args);
va_end(args);
if (waddstr(win, c_printscanbuf) == ERR)
return (retval);
retval = (strlen(c_printscanbuf));
return (retval);
}